/* GUI CONVERTED from ececrp01.p (converter v1.75) Wed Sep 27 08:25:02 2000 */
/* ececrp01.p - ENGINEERING CHANGE ORDERS BY PART REPORT                   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                     */
/* All rights reserved worldwide.  This is an unpublished work.            */
/*F0PN*/ /*K136*/ /*V8:ConvertMode=Report                                  */
/* REVISION: 7.4      LAST MODIFIED: 10/07/93   BY: qzl *H013*             */
/* REVISION: 7.4      LAST MODIFIED: 04/25/95   BY: qzl *H0D4*             */
/* REVISION: 7.4      LAST MODIFIED: 05/30/96   BY: rvw *H0LB*             */
/* REVISION: 7.4      LAST MODIFIED: 09/10/96  BY: *H0MM* Murli Shastri    */
/* REVISION: 8.6      LAST MODIFIED: 04/01/97  BY: *K08X* Joe Gawel        */
/* REVISION: 8.6      LAST MODIFIED: 10/20/97  BY: mur *K136*              */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98  BY: *L007* A. Rahane        */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98  BY: *J314* Alfred Tan       */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00  BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00  BY: *N0KW* Jacolyn Neder    */
/* REVISION: 9.1      LAST MODIFIED: 08/24/00  BY: *N0MZ* Rajinder Kamra   */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

        {mfdeclre.i}
        {gplabel.i} /* EXTERNAL LABEL INCLUDE */

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE ececrp01_p_3 "Category"
/* MaxLen: Comment: */

&SCOPED-DEFINE ececrp01_p_6 "Net Change!This PCC"
/* MaxLen: Comment: */

&SCOPED-DEFINE ececrp01_p_8 "Net Change!Prev Rel PCC"
/* MaxLen: Comment: */

&SCOPED-DEFINE ececrp01_p_11 "Current!Value"
/* MaxLen: Comment: */

&SCOPED-DEFINE ececrp01_p_13 "Final Value"
/* MaxLen: Comment: */

/*N0MZ
 * &SCOPED-DEFINE ececrp01_p_1 "status"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ececrp01_p_2 "Design Group"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ececrp01_p_4 "Prod Line"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ececrp01_p_5 "Drawing"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ececrp01_p_7 "Drawing Size"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ececrp01_p_9 "Drawing Loc"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ececrp01_p_10 "New Rev"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ececrp01_p_12 "Group"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE ececrp01_p_14 "Item Type"
 * /* MaxLen: Comment: */
 *N0MZ*/
/* ********** End Translatable Strings Definitions ********* */

/*K136*/ {wbrp02.i}

         define shared variable ecmnbr like ecm_nbr.
/*H0LB*  define variable desc1 like pt_desc1.      */
/*H0LB*/ define variable desc1 as character format "x(49)".
/*H0LB*  define variable desc2 like pt_desc2.      */
         define variable um like pt_um.
         define variable rev like pt_rev.
         define variable old_part like ecd_part.
         define variable line_count as integer.
         define variable i as integer.

         define buffer ecddet for ecd_det.
         define buffer ecmmstr for ecm_mstr.

/*H0MM*/ /* CHANGED VARIABLES line dgrp type stat pgrp drwg dlog dsiz &   */
         /* drev FROM format "x(12)" TO "x(18)".                          */
         define variable line like ecd_prodline  extent 5 format "x(18)".
         define variable dgrp like ecd_dsgn_grp  extent 5 format "x(18)".
         define variable type like ecd_part_type extent 5 format "x(18)".
         define variable stat like ecd_status    extent 5 format "x(18)".
         define variable pgrp like ecd_group     extent 5 format "x(18)".
         define variable drwg like ecd_draw      extent 5 format "x(18)".
         define variable dloc like ecd_drwg_loc  extent 5 format "x(18)".
         define variable dsiz like ecd_drwg_size extent 5 format "x(18)".
         define variable drev like ecd_new_rev   extent 5 format "x(18)".

/*N0MZ*
 *       line[1] = {&ececrp01_p_4}.
 *       dgrp[1] = {&ececrp01_p_2}.
 *       type[1] = {&ececrp01_p_14}.
 *       stat[1] = {&ececrp01_p_1}.
 *       pgrp[1] = {&ececrp01_p_12}.
 *       drwg[1] = {&ececrp01_p_5}.
 *       dloc[1] = {&ececrp01_p_9}.
 *       dsiz[1] = {&ececrp01_p_7}.
 *       drev[1] = {&ececrp01_p_10}.
 *N0MZ*/
/*N0MZ*/ assign
            line[1] = getTermLabel("PRODUCT_LINE",18)
            dgrp[1] = getTermLabel("DESIGN_GROUP",18)
            type[1] = getTermLabel("ITEM_TYPE",18)
            stat[1] = getTermLabel("STATUS",18)
            pgrp[1] = getTermLabel("GROUP",18)
            drwg[1] = getTermLabel("DRAWING",18)
            dloc[1] = getTermLabel("DRAWING_LOC",18)
            dsiz[1] = getTermLabel("DRAWING_SIZE",18)
            drev[1] = getTermLabel("NEW_REVISION",18).

         /* FIND AND DISPLAY */
         for each ecd_det where ecd_nbr = ecmnbr
         no-lock by ecd_part by ecd_start with frame c width 132:

            do i = 2 to 5:
               line[i] = "".
               dgrp[i] = "".
               type[i] = "".
               stat[i] = "".
               pgrp[i] = "".
               drwg[i] = "".
               dloc[i] = "".
               dsiz[i] = "".
               drev[i] = "".
            end.

/*H0MM*  * * BEGIN DELETE SECTION * *
 *         FORM
 *         LINE[1] COLON 27     column-label "Category"
 *         LINE[2] COLON 45     column-label "Original!Value"
 * /*H0D4*  LINE[3] COLON 60     column-label "Net Change!Upto This ECN" */
 * /*H0D4*/ LINE[3] COLON 60     column-label "Net Change!Prev Rel ECN"
 *         LINE[4] COLON 78     column-label "Net Change!This ECN"
 *         LINE[5] COLON 93    column-label "Final Value"
 *         WITH FRAME C WIDTH 132 NO-ATTR-SPACE no-box.
 **H0MM* * * * END DELETE SECTION */

/*H0MM*/    /*BEGIN ADD SECTION */
            FORM /*GUI*/ 
               line[1] colon 14     column-label {&ececrp01_p_3}
               line[2] colon 36     column-label {&ececrp01_p_11}
/*K08X*        line[3] colon 58     column-label "Net Change!Prev Rel ECN"  */
/*K08X*/       line[3] colon 58     column-label {&ececrp01_p_8}
/*K08X*        line[4] colon 80     column-label "Net Change!This ECN"      */
/*K08X*/       line[4] colon 80     column-label {&ececrp01_p_6}
               line[5] colon 102    column-label {&ececrp01_p_13}
            with STREAM-IO /*GUI*/  frame c width 132 no-attr-space no-box.

            /* SET EXTERNAL LABELS */
            setFrameLabels(frame C:handle).
/*H0MM*/    /* END ADD SECTION */

            desc1 = "".
            um = "".
            rev = "".

            find pt_mstr where pt_part = ecd_part no-lock no-error.
            if available pt_mstr then do:
/*N0MZ*/       assign
                  desc1 = pt_desc1 + " " + pt_desc2
                  line[2] = pt_prod_line
                  dgrp[2] = pt_dsgn_grp
                  type[2] = pt_part_type
                  stat[2] = pt_status
                  pgrp[2] = pt_group
                  drwg[2] = pt_draw
                  dloc[2] = pt_drwg_loc
                  dsiz[2] = pt_drwg_size
                  drev[2] = pt_rev.
            end.

/*H0D4*     LINE[5] = PT_PROD_LINE.  */
/*H0D4*/    line[5] = ecd_prodline.
/*N0MZ*/    assign
               dgrp[5] = ecd_dsgn_grp
               type[5] = ecd_part_type
               stat[5] = ecd_status
               pgrp[5] = ecd_group
               drwg[5] = ecd_draw
               dloc[5] = ecd_drwg_loc
               dsiz[5] = ecd_drwg_size
               drev[5] = ecd_new_rev.

            for each ecddet  no-lock
            where ecddet.ecd_part = ecd_det.ecd_part
            and ecddet.ecd_nbr <> ecd_det.ecd_nbr,
            each ecmmstr no-lock where ecm_nbr = ecddet.ecd_nbr
            and ecm_rel_date <> ? and ecm_end_date = ? and ecm_close_date = ?
            by ecm_rel_date descending:
               line[3] = pt_prod_line.
               dgrp[3] = ecd_dsgn_grp.
               type[3] = ecd_part_type.
               stat[3] = ecd_status.
               pgrp[3] = ecd_group.
               drwg[3] = ecd_draw.
               dloc[3] = ecd_drwg_loc.
               dsiz[3] = ecd_drwg_size.
               drev[3] = ecd_new_rev.
               leave.
            end.

            if line[5] <> line[3] then line[4] = line[5].
            if dgrp[5] <> dgrp[3] then dgrp[4] = dgrp[5].
            if type[5] <> type[3] then type[4] = type[5].
            if stat[5] <> stat[3] then stat[4] = stat[5].
            if pgrp[5] <> pgrp[3] then pgrp[4] = pgrp[5].
            if drwg[5] <> drwg[3] then drwg[4] = drwg[5].
            if dloc[5] <> dloc[3] then dloc[4] = dloc[5].
            if dsiz[5] <> dsiz[3] then dsiz[4] = dsiz[5].
            if drev[5] <> drev[3] then drev[4] = drev[5].

            if line[3] =  line[2] then line[3] = "".
            if dgrp[3] =  dgrp[2] then dgrp[3] = "".
            if type[3] =  type[2] then type[3] = "".
            if stat[3] =  stat[2] then stat[3] = "".
            if pgrp[3] =  pgrp[2] then pgrp[3] = "".
            if drwg[3] =  drwg[2] then drwg[3] = "".
            if dloc[3] =  dloc[2] then dloc[3] = "".
            if dsiz[3] =  dsiz[2] then dsiz[3] = "".
            if drev[3] =  drev[2] then drev[3] = "".

            FORM /*GUI*/ 
/*H0LB*        pt_part         colon 25   format "x(12)"    */
/*H0LB*/       pt_part         colon 25   space(2)
/*H0LB*        desc1           colon 40   no-label          */
/*H0LB*/       desc1           no-label
               ecd_inv_dspn    colon 25
            with STREAM-IO /*GUI*/  frame d side-labels width 132 no-attr-space.

            /* SET EXTERNAL LABELS */
            setFrameLabels(frame d:handle).

            display
               pt_part
               ecd_inv_dspn
               desc1
            with frame d STREAM-IO /*GUI*/ .

            display
               line[1]
               line[2]
               line[3]
               line[4]
               line[5]
            with frame c STREAM-IO /*GUI*/ .
            down.

            display
               dgrp[1] @ line[1]
               dgrp[2] @ line[2]
               dgrp[3] @ line[3]
               dgrp[4] @ line[4]
               dgrp[5] @ line[5]
            with frame c STREAM-IO /*GUI*/ .
            down.

            display
               type[1] @ line[1]
               type[2] @ line[2]
               type[3] @ line[3]
               type[4] @ line[4]
               type[5] @ line[5]
            with frame c STREAM-IO /*GUI*/ .
            down.

            display
               stat[1] @ line[1]
               stat[2] @ line[2]
               stat[3] @ line[3]
               stat[4] @ line[4]
               stat[5] @ line[5]
            with frame c STREAM-IO /*GUI*/ .
            down.

            display
               pgrp[1] @ line[1]
               pgrp[2] @ line[2]
               pgrp[3] @ line[3]
               pgrp[4] @ line[4]
               pgrp[5] @ line[5]
            with frame c STREAM-IO /*GUI*/ .
            down.

            display
               drwg[1] @ line[1]
               drwg[2] @ line[2]
               drwg[3] @ line[3]
               drwg[4] @ line[4]
               drwg[5] @ line[5]
            with frame c STREAM-IO /*GUI*/ .
            down.

            display
               dloc[1] @ line[1]
               dloc[2] @ line[2]
               dloc[3] @ line[3]
               dloc[4] @ line[4]
               dloc[5] @ line[5]
            with frame c STREAM-IO /*GUI*/ .
            down.

            display
               dsiz[1] @ line[1]
               dsiz[2] @ line[2]
               dsiz[3] @ line[3]
               dsiz[4] @ line[4]
               dsiz[5] @ line[5]
            with frame c STREAM-IO /*GUI*/ .
            down.

            display
               drev[1] @ line[1]
               drev[2] @ line[2]
               drev[3] @ line[3]
               drev[4] @ line[4]
               drev[5] @ line[5]
            with frame c STREAM-IO /*GUI*/ .
            down 2.

            if ecd_cmtindx <> 0 then do:
               {gpcmtprt.i &type=RP &id=ecd_cmtindx &pos=27}
            end.

            display skip(2) with frame XXX STREAM-IO /*GUI*/ .

         end.

/*K136*/ {wbrp04.i}
